JHipster Console demo

JHipster also provides a console application based on the Elastic Stack (often referred to as ELK), which can be used for logs and metrics monitoring of the application. JHipster Console is another open source application. It is really useful and provides some nice dashboards that can be used to visualize the application. As with other JHipster products, it is much easier to get started with the JHipster Console. 

The JHipster Console project is available in GitHub (https://github.com/jhipster/jhipster-console).

Our applications stream the metrics and logs into the JHipster console. To make that happen, there are a few settings in the application-prod.yml file in all the applications (gateway and microservices applications):

  metrics:
logs: # Reports metrics in the logs
enabled: false
report-frequency: 60 # in seconds
logging:
use-json-format: false # By default, logs are not in Json format
logstash: # Forward logs to logstash over a socket, used by
LoggingConfiguration
enabled: false
host: localhost
port: 5000
queue-size: 512

The metrics.logs.enabled and logging.logstash.enabled properties must be set to true. However, since we generated the docker-compose setup using JHipster, it created a file called docker-compose/central-server-config/application.yml, which will be used by the config server to override the preceding settings. This will push the logs to the console application. The JHipster Console will collect this information and show it in nice-looking dashboards with the help of Kibana. The following is the generated config file that's used by the config server:

...
jhipster:
security:
authentication:
jwt:
base64-secret: ...
logging:
logstash: # forward logs to ELK
enabled: true
host: jhipster-logstash
metrics:
logs: # report metrics in the logs
enabled: true
report-frequency: 60 # in seconds
spring:
zipkin:
base-url: http://jhipster-zipkin:9411
enabled: true
sleuth:
sampler:
probability: 1 # report 100% of traces to Zipkin
eureka:
client:
service-url:
defaultZone: http://admin:${jhipster.registry.password}@
jhipster-registry:8761/eureka/

Let's look at the JHipster Console running on http://localhost:5601.

The JHipster Console provides the following (customizable) dashboards in Kibana:

It also provides preconfigured dashboards for logs, application-level metrics such as JVM threads metrics, and other details:

Added to this, the console also has an interface where we can see the application logs. It shows the log of all the applications we've deployed. We can filter and search the logs with respect to the application:

Since we chose Zipkin integration, the Zipkin server is also configured and the trace details can be viewed in its UI, which is provided as part of the JHipster Console and integrates with the Kibana dashboard, at http://127.0.0.1:9411/, or from the trace data that was integrated into the Kibana dashboard in the JHipster Console:

Zipkin tracing is disabled by default. To enable Zipkin tracing, we need to include the zipkin profile when we build our images and need to set the spring.zipkin.enabled property to true in the application configurations. The configuration is enabled when running the preceding Docker Compose setup, but the images still need to be built with the zipkin Gradle profile. This will trigger span reporting to the Zipkin server and also add correlation IDs (traceID, spanID, and parentID) to request headers and logs.

You can learn more about the JHipster Console by visiting https://www.jhipster.tech/monitoring/#jhipster-console.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset