Prometheus is an open-source systems monitoring toolkit that you can use with Red Hat Process Automation Manager to collect and store metrics related to the execution of business rules, processes, Decision Model and Notation (DMN) models, and other Red Hat Process Automation Manager assets. You can access the stored metrics through a REST API call to the KIE Server, through the Prometheus expression browser, or using a data-graphing tool such as Grafana.
For additional infromation configure Prometheus metrics monitoring refer here.
EAP: JBOSS 7.3.3
RHPAM: 7.9
After you configure your KIE Server instance to use Prometheus metrics monitoring, you can extend the Prometheus functionality in KIE Server to use custom metrics according to your business needs. Prometheus then collects and stores your custom metrics along with the default metrics that KIE Server exposes with Prometheus.
For additional infromation related to custom Prometheus metrics addition refer here.
By implementing the PrometheusMetricsProvider interface, with the following listners
- DMNRuntimeEventListener
- AgendaEventListener
- PhaseLifecycleListener
- AsynchronousJobListener
- DeploymentEventListener can be defineed and the custom metrics to be collected and stored by Prometheus.
To collect the additional metrics (like how many tasks assigned to specific user etc) for the process or the task or To implment custom metrics for TaskLifeCycleEventListener, other listeners follow the below steps.
- In this project TaskLevelCustomPrometheusMetricListener implemented TaskLifeCycleEventListener. Added two custom metrics for demo purpose.
- Build your project (maven build) and copy the resulting JAR file into the ~/kie-server.war/WEB-INF/lib directory of your project. For example, on Red Hat JBoss EAP, the path to this directory is EAP_HOME/standalone/deployments/kie-server.war/WEB-INF/lib.
- To generate the metrics for the KJAR, create an Task Event Listner object.
- Now you can observe the newly added metrics.
- In this project TaskLevelCustomPrometheusMetricListener implemented TaskLifeCycleEventListener. Added two custom metrics for demo purpose.
- Build your project (maven build) and add the resulting JAR file as dependency in spring-boot (pom.xml) service.
- To generate the metrics for the KJAR, create an Task Event Listner object.
- Now you can observe the newly added metrics.
- Counters can only go up (and be reset), if your use case can go down you should use Gauge instead.