◷ 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 /api/stats/metrics
.
Metrics
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
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
Download a version for your OS. Installation is as simple as unzipping the package and you can see below files:
- prometheus.exe
- prometheus.yml
Configure
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 scrape_configs
section:
- 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']
- basic_auth
- 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
- frs_dotnet_totalmemory
- frs_gc_collection_count_total
- frs_process_cpu_seconds_total
- frs_process_start_time_seconds
- frs_process_windows_num_threads
- frs_process_windows_private_bytes
- frs_process_windows_virtual_bytes
- frs_process_windows_working_set
- Execution:
- frs_execution_failed
- frs_execution_successful
- frs_execution_successful_speed
- Resources
- frs_license_allowed_total
- frs_resources
- frs_resources_application
- frs_resources_package
- frs_resources_service
- frs_resources_user
- frs_resources_workflow_instances_count
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
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:
