Hystrix
Hystrix copied to clipboard
Unable to configure hystrix dashboard
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
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;
}
}
}
Dependies:
<groupId>org.springframework.cloud</groupId>
<artifactId>spring-cloud-starter-parent</artifactId>
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?
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
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
when I followed the link from Request URL , I get a blank page.
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.
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.
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
I'm with the same issue. Any solution?
Any resolution to this issue ?
@All - Could you please guide me here: https://stackoverflow.com/questions/59738969/unable-to-connect-to-command-metric-stream-in-hystrix-dashboard-issue ?
Hystrix dashboard is not able to load data as shown in the attachment. Any Solution ?
Still get same issue, anyone correct it?