In a microservices architecture, we need to monitor our services continuously and any issues should cause alerts immediately. We need a separate service that will continuously monitor and alert us whenever something weird happens. Prometheus is an alternative monitoring solution we can use.
Prometheus, along with Grafana, can be an alternative to JHipster Console. It provides monitoring and alerting support. This requires running a Prometheus server and Grafana separately. Visit https://www.jhipster.tech/monitoring/#configuring-metrics-forwarding to learn about using Prometheus with JHipster. To get started with Prometheus, visit https://prometheus.io/.
Prometheus consists of the following:
- Prometheus server, which is responsible for scraping and storing the time series data
- Libraries to instrument the application code
- A push gateway for supporting short-lived jobs
- An exporter to Grafana to visualize data
- An alert manager
- Other support tools
Let's now look at the benefits of Prometheus:
- It provides multi-dimensional data models, which are time series and are identified by metric names and key-value pairs.
- It has a flexible dynamic query language. It supports pulling time series out of the box and pushing time series via an intermediary gateway.
- It has multiple modes of graphing and dashboard support.
- It is helpful in identifying problems when there is an outage. Since it is autonomous and does not depend on any remote services, the data is sufficient for finding where the infrastructure is broken.
- It is helpful in recording the time series data and monitoring either via machine or highly dynamic service-oriented architecture.
Some things to consider when choosing Prometheus over JHipster Console are as follows:
- Prometheus is very good at exploiting the metrics of your application and will not monitor logs or traces. JHipster Console, on the other hand, uses the Elastic Stack and monitors the logs, traces, and metrics of your application.
- Prometheus can be used to query a huge amount of time series data. ELK on JHipster Console is much more versatile in terms of tracking and searching the metrics and logs.
- JHipster Console uses Kibana to visualize the data, while Prometheus uses Grafana (https://grafana.com/) to visualize the metrics.