Giter VIP home page Giter VIP logo

martindevillers / spring-boot-admin-hystrix-dashboard Goto Github PK

View Code? Open in Web Editor NEW
23.0 2.0 3.0 3.03 MB

๐Ÿ–ฅ๏ธ Hystrix Dashboard as a Spring Boot Admin 2.x Compatible Plugin

Home Page: https://mvnrepository.com/artifact/nl.devillers/spring-boot-admin-hystrix-dashboard

License: Apache License 2.0

JavaScript 70.32% Vue 29.68%
spring-boot-admin spring-boot-actuator hystrix-dashboard hystrix spring-boot vue

spring-boot-admin-hystrix-dashboard's Introduction

Hystrix Dashboard for Spring Boot Admin 2.x

Maven Central Build Status

This module adds Hystrix Dashboard to Spring Boot Admin 2.x. It is implemented as a Custom View Module using the spring-boot-admin-sample-custom-ui project as a template. If you have any questions, issues, feedback or doubts, feel free to open a new issue and I'll reply as soon as possible.

Screenshot dashboard

Disclaimer: I quickly hacked this together in my spare time to get my client's Hystrix Dashboard back up-and-running after upgrading a dozen applications from Spring Boot 1 to 2. As of 19 november 2018, Hystrix has entered maintenance mode. If you're doing a greenfield project I suggest you look into a more modern fault tolerance library like resilience4j and using Grafana to generate a dashboard. For those without this luxury, I hope this module will suffice.


Using this module

Prerequisites

Before using this module, ensure that both the server and all clients use the correct dependencies:

Installation

To use this module, simply add the following Maven dependency to your Spring Boot Admin application's pom.xml, rebuild, deploy and enjoy!

<dependency>
    <groupId>nl.devillers</groupId>
    <artifactId>spring-boot-admin-hystrix-dashboard</artifactId>
    <version>1.0.2</version>
</dependency>

Troubleshooting

Below are some typical issues you may run into while using this module. If this information doesn't help you, then don't hesitate to open a new issue here on GitHub. Or you can browse the list of existing issues to gain some more insight into debugging this stack.

The Hystrix tab doesn't appear in Spring Boot Admin

If the Hystrix option does not appear in the instances view, then first make sure that Spring Boot Admin has loaded this module correctly by checking the logs during startup. The logs should show two entries like the following:

2019-11-15 13:31:30.627  INFO 17624 --- [           main] b.a.s.u.c.AdminServerUiAutoConfiguration : Loaded Spring Boot Admin UI Extension: UiExtension(resourcePath=hystrix-dashboard/css/custom.6134ab29.css, resourceLocation=classpath:/META-INF/spring-boot-admin-server-ui/extensions/hystrix-dashboard/css/custom.6134ab29.css)
2019-11-15 13:31:30.628  INFO 17624 --- [           main] b.a.s.u.c.AdminServerUiAutoConfiguration : Loaded Spring Boot Admin UI Extension: UiExtension(resourcePath=hystrix-dashboard/js/custom.6b4c7d50.js, resourceLocation=classpath:/META-INF/spring-boot-admin-server-ui/extensions/hystrix-dashboard/js/custom.6b4c7d50.js)

Second, check that the Hystrix Stream endpoint in the Spring Boot application is properly exposed to Spring Boot Actuator by querying the discovery endpoint. This endpoint is accessible at the base-path of Spring Boot Actuator (default: /actuator). The output should list an entry for hystrix.stream:

{
	"_links": {
		"self": {
			"href": "http://my.awesome.spring.boot.application.com/actuator",
			"templated": false
		},
		...
		"hystrix.stream": {
			"href": "http://my.awesome.spring.boot.application.com/actuator/hystrix.stream",
			"templated": false
		}
	}
}

If this is not the case, make sure that:

  • The management.endpoints.web.exposure.include property includes the hystrix.stream endpoint (or * for all endpoints)
  • The application is annotated with the org.springframework.cloud.netflix.hystrix.EnableHystrix annotation from the spring-cloud-starter-netflix-hystrix package
The Hystrix tab is there, but when I click it I see a white screen or browser error page

This problem is probably caused by your browser refusing to load the IFRAME used by this plugin to load the dashboard. First open your browser developer tools and check for any error messages like Refused to connect <your domain>, Refused to display <your domain> in a frame or Load denied by X-FRAME-OPTIONS. If you see a message similar to this, check the security configuration of your Spring Boot Admin application (or load balancer) for a policy that adds the X-Frame-Options and/or Content-Security-Policy header to the response. Note that neither Spring Boot Admin nor this plugin add these headers by default (or any security for that matter).

The Hystrix Dashboard is loaded, but displays the following error message: Unable to connect to Command Metric Stream.

This error message appears if there is a connectivity issue. Connectivity issues can be tricky to solve as the datastream is proxied through Spring Boot Admin and, depending on your infrastructure, may pass through multiple load balancers and firewalls. Here are some pointers:

  • The browser failed to connect to the Spring Boot Admin proxy. Open the Developer Tools of the browser and look for error messages either in the console or network tab. There should be an attempt to access the stream on a path like the following: https://{your-spring-boot-admin-server-hostname}/instances/{your-instance-id}/actuator/hystrix.stream
  • The Spring Boot Admin proxy failed to connect to the Spring Boot client application. Investigate the server logs of Spring Boot Admin for more information.
  • The Spring Boot client application refused the connection to its Hystrix Metrics Event Stream endpoint. Investigate the server logs of the Spring Boot client application for more information. Typical causes are restrictive endpoint security policies configured within the client application.
The Hystrix Dashboard visualization sometimes pauses or stops completely after a few minutes

Unfortunately I haven't found a solution for this problem yet. In my professional projects this was never a major issue as the dashboard was only used to briefly inspect an application's behavior. When the dashboard freezes, a browser refresh will bring it back to life. If you intend to use this visualization for long-term monitoring or on a permanent information radiator, this setup may not be satisfactory. If this is your use case, I would suggest looking into a more robust setup (e.g. Grafana).


Building this module

The jar can be build with Maven with the maven-exec-plugin. To do this node.js and npm must be installed on your machine and be on your $PATH. If you don't want to use the maven exec run the following commands:

Running Spring Boot Admin Server for development

To develop the ui on an running server the best to do is

  1. Running the ui build in watch mode so the resources get updated:
npm run watch
  1. Run a Spring Boot Admin Server instances with the template-location and resource-location pointing to the build output and disable caching:
spring.boot.admin.ui.cache.no-cache: true
spring.boot.admin.ui.extension-resource-locations: file:@project.basedir@/../spring-boot-admin-hystrix-dashboard/target/dist/
spring.boot.admin.ui.cache-templates: false

Or just start the spring-boot-admin-sample-servlet project using the dev profile.

Build

npm install
npm run build

Repeated build with watching the files:

npm run watch

spring-boot-admin-hystrix-dashboard's People

Contributors

martindevillers avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

spring-boot-admin-hystrix-dashboard's Issues

Dashboard not working with non-standard base-path

Hi @MartinDevillers , thanks a lot for publishing the dashboard.

When using a non-standard actuator-endpoint opening the hystrix dashboard results in a 404 error page.

Actuator config:

management:
  endpoints:
    web:
      base-path: /manage

Manage endpoint shows up correctly in SBA, link in /manage points to the right hystrix.stream as well.

Versions:

  • spring-boot-admin-hystrix-dashboard 1.0.1
  • Spring 2.1.6.Release
  • Spring Cloud Greenwich.SR2

Dashboard 1.0.2 version does not work with SBA 2.1.1

Hello @MartinDevillers , I faced following problem:
SBA server version 2.1.1, spring-boot-admin-hystrix-dashboard version 1.0.2.
Hystrix stream on client side exists and is working fine - it is exposed via explicit servlet configuration:

  public ServletRegistrationBean statisticsStream() {
    return new ServletRegistrationBean(
        new HystrixMetricsStreamServlet(), "/actuator/hystrix.stream");
  }

Calling https://client-url/actuator/hystrix.stream returns valid data:

ping: 

data: {"type":"HystrixCommand","name":"ValidationCommandKey","group":"ReceiptValidationHystrixCommand","currentTime":1579713161842,"isCircuitBreakerOpen":false,"errorPercentage":0,"errorCount":0,"requestCount":0,"rollingCountBadRequests":0,"rollingCountCollapsedRequests":0,"rollingCountEmit":0,"rollingCountExceptionsThrown":0,"rollingCountFailure":0,"rollingCountFallbackEmit":0,"rollingCountFallbackFailure":0,"rollingCountFallbackMissing":0,"rollingCountFallbackRejection":0,"rollingCountFallbackSuccess":0,"rollingCountResponsesFromCache":0,"rollingCountSemaphoreRejected":0,"rollingCountShortCircuited":0,"rollingCountSuccess":0,"rollingCountThreadPoolRejected":0,"rollingCountTimeout":0,"currentConcurrentExecutionCount":0,"rollingMaxConcurrentExecutionCount":0,"latencyExecute_mean":0,"latencyExecute":{"0":0,"25":0,"50":0,"75":0,"90":0,"95":0,"99":0,"99.5":0,"100":0},"latencyTotal_mean":0,"latencyTotal":{"0":0,"25":0,"50":0,"75":0,"90":0,"95":0,"99":0,"99.5":0,"100":0},"propertyValue_circuitBreakerRequestVolumeThreshold":10,"propertyValue_circuitBreakerSleepWindowInMilliseconds":5000,"propertyValue_circuitBreakerErrorThresholdPercentage":50,"propertyValue_circuitBreakerForceOpen":false,"propertyValue_circuitBreakerForceClosed":false,"propertyValue_circuitBreakerEnabled":true,"propertyValue_executionIsolationStrategy":"THREAD","propertyValue_executionIsolationThreadTimeoutInMilliseconds":1000,"propertyValue_executionTimeoutInMilliseconds":1000,"propertyValue_executionIsolationThreadInterruptOnTimeout":true,"propertyValue_executionIsolationThreadPoolKeyOverride":null,"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_metricsRollingStatisticalWindowInMilliseconds":10000,"propertyValue_requestCacheEnabled":true,"propertyValue_requestLogEnabled":true,"reportingHosts":1,"threadPool":"ReceiptValidationHystrixCommand"}

data: {"type":"HystrixCommand","name":"DataCommitCommandKey","group":"DataCommitHystrixCommand","currentTime":1579713161842,"isCircuitBreakerOpen":false,"errorPercentage":0,"errorCount":0,"requestCount":0,"rollingCountBadRequests":0,"rollingCountCollapsedRequests":0,"rollingCountEmit":0,"rollingCountExceptionsThrown":0,"rollingCountFailure":0,"rollingCountFallbackEmit":0,"rollingCountFallbackFailure":0,"rollingCountFallbackMissing":0,"rollingCountFallbackRejection":0,"rollingCountFallbackSuccess":0,"rollingCountResponsesFromCache":0,"rollingCountSemaphoreRejected":0,"rollingCountShortCircuited":0,"rollingCountSuccess":0,"rollingCountThreadPoolRejected":0,"rollingCountTimeout":0,"currentConcurrentExecutionCount":0,"rollingMaxConcurrentExecutionCount":0,"latencyExecute_mean":0,"latencyExecute":{"0":0,"25":0,"50":0,"75":0,"90":0,"95":0,"99":0,"99.5":0,"100":0},"latencyTotal_mean":0,"latencyTotal":{"0":0,"25":0,"50":0,"75":0,"90":0,"95":0,"99":0,"99.5":0,"100":0},"propertyValue_circuitBreakerRequestVolumeThreshold":10,"propertyValue_circuitBreakerSleepWindowInMilliseconds":5000,"propertyValue_circuitBreakerErrorThresholdPercentage":50,"propertyValue_circuitBreakerForceOpen":false,"propertyValue_circuitBreakerForceClosed":false,"propertyValue_circuitBreakerEnabled":true,"propertyValue_executionIsolationStrategy":"THREAD","propertyValue_executionIsolationThreadTimeoutInMilliseconds":1000,"propertyValue_executionTimeoutInMilliseconds":1000,"propertyValue_executionIsolationThreadInterruptOnTimeout":true,"propertyValue_executionIsolationThreadPoolKeyOverride":null,"propertyValue_executionIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_fallbackIsolationSemaphoreMaxConcurrentRequests":10,"propertyValue_metricsRollingStatisticalWindowInMilliseconds":10000,"propertyValue_requestCacheEnabled":true,"propertyValue_requestLogEnabled":true,"reportingHosts":1,"threadPool":"DataCommitHystrixCommand"}

But when I open application is SBA I can't see hystrix dashboard
image
Can you help to resolve this issue? Thanks in advance.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.