Netflix / Hystrix

Hystrix is a latency and fault tolerance library designed to isolate points of access to remote systems, services and 3rd party libraries, stop cascading failure and enable resilience in complex distributed systems where failure is inevitable.
24.07k stars 4.7k forks source link

Unable to configure hystrix dashboard #1526

Open bsushant-athena opened 7 years ago

bsushant-athena commented 7 years ago

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 commented 7 years ago

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 commented 7 years ago

Dependies:

org.springframework.cloudspring-cloud-starter-parentAngel.SR6 org.springframework.cloudspring-cloud-starter-eureka-serverorg.springframework.bootspring-boot-starter-loggingorg.springframework.cloudspring-cloud-starter-zuulorg.springframework.bootspring-boot-starter-loggingorg.springframework.cloudspring-cloud-starter-hystrix-dashboardorg.springframework.bootspring-boot-starter-actuatororg.springframework.cloudspring-cloud-starter-hystrix
mattrjacobs commented 7 years ago

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?

bsushant-athena commented 7 years ago

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

mattrjacobs commented 7 years ago

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

bsushant-athena commented 7 years ago

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

mattrjacobs commented 7 years ago

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.

mrumpf commented 6 years ago

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.

kevinojt commented 6 years ago

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
IgorRamosBR commented 5 years ago

I'm with the same issue. Any solution?

javaHelper commented 4 years ago

Any resolution to this issue ?

javaHelper commented 4 years ago

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

rk1023 commented 4 years ago

HystrixDashBoardError

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

pcdubaipc commented 3 years ago

Still get same issue, anyone correct it?