user3397979
user3397979

Reputation: 49

Hystrix dashboard always showing loading screen

I have developed Micro service application using Netflix-OSS libraries. I am facing issue on Hystrix dashboard running on localhost:9091/hystrix. I want to monitor request metrics between Micro service-A and Micro service-B. Endpoint "hystrix.stream" is already registered.

hystrix dashboard stucks on loading without showing any results.

I inspected browser and found jquery error - Uncaught TypeError: e.indexOf is not a function which seems to be a jquery version issue.

I am using Jdk 14 version and Spring boot 2.3 for my development

Upvotes: 3

Views: 1637

Answers (3)

user3397979
user3397979

Reputation: 49

This issue got fixed by adding following configuration changes:
1. Updating Hoxton to SR7 in pom.xml:
   <properties>
        <java.version>14</java.version>
        <spring-cloud.version>Hoxton.SR7</spring-cloud.version>
    </properties>
2. Add these entries in application.yml:
hystrix:
  dashboard:
    proxy-stream-allow-list: '*'        
        
management:
  endpoints:
    web:
      base-path: /
      exposure:
        include: '*'
3. Creating a separate config Java class:
package com.ibm.drama.controller;

import org.springframework.boot.web.servlet.ServletRegistrationBean;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

import com.netflix.hystrix.contrib.metrics.eventstream.HystrixMetricsStreamServlet;

@Configuration
public class HystrixConfig {

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

Upvotes: 0

Yuva
Yuva

Reputation: 201

Updating the spring-cloud-dependencies version to "Hoxton.SR7" resolved the problem for me. There is an issue with jquery 3.4.1 with spring-cloud-dependencies version "Hoxton.SR6".

You can get the details of the issue and the fix here. https://github.com/spring-cloud/spring-cloud-netflix/issues/3811 https://github.com/spring-cloud/spring-cloud-netflix/pull/3817

Upvotes: 0

user3397979
user3397979

Reputation: 49

            @bob0the0mighty
            I am adding code snippet for your reference. This is my springboot main class
            @SpringBootApplication
            @EnableEurekaClient
            @EnableCircuitBreaker
            @EnableHystrixDashboard
            public class DramaServiceApplication {
            }
        My controller looks like :
        @GetMapping("/acts")
            @com.netflix.hystrix.contrib.javanica.annotation.HystrixCommand(fallbackMethod = "fallbackMethodForGetActor", commandKey = "test-Act", groupKey = "test-Act")
            public ActorList getActors() {
                ActorList actorList = restTemplate.getForObject("http://actor-service/actor/actorsList", ActorList.class);
                return actorList;
            }
    public ActorList fallbackMethodForGetActor() {
            return new ActorList(" Requested Actor page is under maintenance!!");
        }
    
    application.yml file looks like :
            
    management:
      endpoints:
        web:
          base-path: /
          exposure:
            include: hystrix.stream, health, info, metrics
After hitting request multiple times, I am getting hystrix dashboard as "loading" always
and screen looks like 
[enter image description here][1]
                


  [1]: https://i.sstatic.net/hOeZf.png

Upvotes: 0

Related Questions