◷ Reading Time: 4 minutes
Monitoring is built into FlexRule Server. The monitoring capability allows your application to collect metrics from different nodes.
There are a couple of different stats for monitoring which then can be collected from
There are couple of group of metrics that can be collected:
- Node usages (total memory, cpu time/usage, etc.)
- Resources (numbers of applications, accounts, roles, packages, services…)
- Licenses (number of available agent slots, total, used, etc.)
- Service Execution (total failed, successful calls, performance, etc.)
Prometheus is an open-source system monitoring and alerting toolkit. You can learn more about its overview. FlexRule Server
/api/stats/metrics exposes the metrics in [prometheus.io] format.
To add the Prometheus monitoring planform to the FlexRule Server infrastructure you can simply:
- Download and install [prometheus.io]
- Configure the Prometheus to collect metrics
- Build a dashboard using Grafana
Download a version for your OS. Installation is as simple as unzipping the package and you can see below files:
Prometheus uses the concept of a Job to scrape information from different nodes. So the only thing you need to do is add a new Job to Prometheus to collect the metrics from FlexRule Server API endpoint.
To add the Job, Open
prometheus.yml and add below into
- job_name: 'frs' metrics_path: /api/stats/metrics basic_auth: username: 'admin' password: 'FlexRuleServer' scrape_interval: 5s scrape_timeout: 5s static_configs: - targets: ['192.168.10.10:9000']
- username: Is the user that has access to call the API metrics
- password: The password for user to authenticate
- targets: the address of the node. This can be configured for all Master and Agent nodes of your clusters.
When Prometheus scrapes the FlexRule Server the following metrics become available:
- Memory and CPU
On the machine you have installed Prometheus, simply navigate to its web address i.e. http://localhost:9090/graph and you can build your simple dashboard:
Prometheus allows building simple graphs for the metrics, but feel free to use any other product to do that so. For example, we use Grafana to create a wonderful dashboard for the FlexRule Server metrics.
Grafana is an open source metric analytics & visualization suite. It is most commonly used for visualizing time series data for infrastructure and application analytics but many use it in other domains including industrial sensors, home automation, weather, and process control.
Once you installed Grafana, you can connect it to the FlexRule Server Prometheus instance that is monitoring the FlexRule Server and build a Dashboard like below: