Hystrix icon indicating copy to clipboard operation
Hystrix copied to clipboard

Unable to configure hystrix dashboard

Open bsushant-athena opened this issue 7 years ago • 14 comments

Hi,

I am new to Hystrix and trying to configure Hystrix dashboard for an application that i am developing. I had gone thru the documentation that is available in GitHub Wiki and was able to configure the application properly in my local environment. When i hit hystrix stream url "http://hostname:port/application/hystrix.stream", it is returning me the JSON data. But if i use the same URL in Hystrix Dashboard, it is not displaying any data in the dashboard.

I traced the request and found that the below link is not returning any response and getting failed.

Error message:

EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection. Connection was closed on error: [object Event]

I tried searching in internet for this issue but was not able to find any solution. In addition to this problem, when hystrix dashboard is not able to establish the connection. Can you please help me with the problems described above? Thanks.

-Sushant

bsushant-athena avatar Apr 05 '17 12:04 bsushant-athena

Code: @SpringBootApplication
@EnableSwagger2
@EnableHystrixDashboard
@EnableHystrix
public class Boot implements CommandLineRunner {

 @Override
 public void run(String... arg0) throws Exception {
 if (arg0.length > 0 && arg0[0].equals("exitcode")) {
 throw new ExitException();
 }
 }

 public static void main(String[] args) throws Exception {
 Map<String,String> pars = MultipleBoot.parseArgs(args);

 SpringApplication springApplication = new SpringApplication(Boot.class);
 springApplication.addListeners(new MultipleBoot.BootstrapConfigProviderListener(pars));
 springApplication.run(args);
 }

 class ExitException extends RuntimeException implements ExitCodeGenerator {
 private static final long serialVersionUID = 1L;

 @Override
 public int getExitCode() {
 return 10;
 }

 }


}

bsushant-athena avatar Apr 05 '17 13:04 bsushant-athena

Dependies:
<groupId>org.springframework.cloud</groupId>
 <artifactId>spring-cloud-starter-parent</artifactId>

Angel.SR6
 <relativePath /> 



 <groupId>org.springframework.cloud</groupId>
 <artifactId>spring-cloud-starter-eureka-server</artifactId>
 
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-logging</artifactId>
 
 <groupId>org.springframework.cloud</groupId>
 <artifactId>spring-cloud-starter-zuul</artifactId>
 
 <groupId>org.springframework.boot</groupId>
 <artifactId>spring-boot-starter-logging</artifactId>
 
 <groupId>org.springframework.cloud</groupId>
 <artifactId>spring-cloud-starter-hystrix-dashboard</artifactId>

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

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


bsushant-athena avatar Apr 05 '17 13:04 bsushant-athena

Can you look at your the Network tab in your Javascript devtools and find out what call is getting made by your dashboard web application?

mattrjacobs avatar Apr 10 '17 22:04 mattrjacobs

Request URL:http://localhost:18888/proxy.stream?origin=http%3A%2F%2Flocalhost%3A18888%2Fpublic%2Fhystrix.stream Request Method:GET Status Code:200 OK Remote Address:[::1]:18888 Referrer Policy:no-referrer-when-downgrade

bsushant-athena avatar Apr 11 '17 05:04 bsushant-athena

OK, what happens when you follow the link from Request URL?

When I run the dashboard locally against some cloud instance, I see the URL: http://localhost:7979/hystrix-dashboard/proxy.stream?origin=cloud Hystrix metrics stream

Hitting that URL gives me back an SSE stream, and my dashboard works correctly

mattrjacobs avatar Apr 14 '17 20:04 mattrjacobs

when I followed the link from Request URL , I get a blank page.

bsushant-athena avatar Apr 19 '17 08:04 bsushant-athena

OK, then that's your problem. You mentioned previously that you can hit a standalone SSE metrics stream. That URL should be the same one that your dashboard is using.

mattrjacobs avatar Apr 19 '17 15:04 mattrjacobs

This might be related: https://github.com/Netflix/Hystrix/issues/68 We are seeing this issue occasionally, which means one request works and the other one not. So the idea is that the Apache load-balancing proxy has a configuration issue on one node whereas the other seems to be correctly configured. Depending on which load-balancer you hit the sream gets interrupted or not.

mrumpf avatar Sep 26 '17 19:09 mrumpf

I have the same issue running https://github.com/sqshq/PiggyMetrics. It works fine when calling turbine stream alone.

curl -v http://10.20.1.169:8989
* Rebuilt URL to: http://10.20.1.169:8989/
*   Trying 10.20.1.169...
* TCP_NODELAY set
* Connected to 10.20.1.169 (10.20.1.169) port 8989 (#0)
> GET / HTTP/1.1
> Host: 10.20.1.169:8989
> User-Agent: curl/7.54.0
> Accept: */*
>
< HTTP/1.1 200 OK
< Content-Type: text/event-stream
< Transfer-Encoding: chunked

But when I put the url in Hystrix Dashboard is gets wrong.

Console output

Stream: http%3A%2F%2F10.20.1.169%3A8989%2Fturbine.stream
monitor?stream=http%3A%2F%2F10.20.1.169%3A8989%2Fturbine.stream&delay=2000&title=hello:108 Command Stream: /proxy.stream?origin=http%3A%2F%2F10.20.1.169%3A8989%2Fturbine.stream&delay=2000
monitor?stream=http%3A%2F%2F10.20.1.169%3A8989%2Fturbine.stream&delay=2000&title=hello:1 EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection.
monitor?stream=http%3A%2F%2F10.20.1.169%3A8989%2Fturbine.stream&delay=2000&title=hello:136 Connection was closed on error: {"isTrusted":true}
monitor?stream=http%3A%2F%2F10.20.1.169%3A8989%2Fturbine.stream&delay=2000&title=hello:1 EventSource's response has a MIME type ("text/plain") that is not "text/event-stream". Aborting the connection.
monitor?stream=http%3A%2F%2F10.20.1.169%3A8989%2Fturbine.stream&delay=2000&title=hello:173 Connection was closed on error: [object Event]

The response headers missing 'Content-Type: text/event-stream'. So the EventSource treat it as 'text/plain'

Content-Length: 0
Date: Sat, 28 Apr 2018 03:58:58 GMT
Server: Apache-Coyote/1.1
X-Application-Context: monitoring

kevinojt avatar Apr 28 '18 04:04 kevinojt

I'm with the same issue. Any solution?

IgorRamosBR avatar Dec 11 '18 12:12 IgorRamosBR

Any resolution to this issue ?

javaHelper avatar Jan 13 '20 08:01 javaHelper

@All - Could you please guide me here: https://stackoverflow.com/questions/59738969/unable-to-connect-to-command-metric-stream-in-hystrix-dashboard-issue ?

javaHelper avatar Jan 15 '20 04:01 javaHelper

HystrixDashBoardError

Hystrix dashboard is not able to load data as shown in the attachment. Any Solution ?

rk1023 avatar Aug 09 '20 13:08 rk1023

Still get same issue, anyone correct it?

pcdubaipc avatar Apr 07 '21 12:04 pcdubaipc