Skip to main content
Prometheus is an open-source systems monitoring toolkit that you can use with jBPM to collect and store metrics related to the execution of business rules, processes, Decision Model and Notation (DMN) models, and other jBPM 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. You can configure Prometheus metrics monitoring for an on-premise KIE Server instance, for KIE Server on Spring Boot, or for a KIE Server deployment on Red Hat OpenShift Container Platform. For the list of available metrics that KIE Server exposes with Prometheus, see the KIE Server Prometheus Extension page in GitHub.

Configuring Prometheus metrics monitoring for KIE Server

You can configure your KIE Server instances to use Prometheus to collect and store metrics related to your business asset activity in jBPM. For the list of available metrics that KIE Server exposes with Prometheus, see the KIE Server Prometheus Extension page in GitHub. Prerequisites
  • KIE Server is installed.
  • You have kie-server user role access to KIE Server.
  • Prometheus is installed. For information about downloading and using Prometheus, see the Prometheus documentation page.
Procedure
  1. In your KIE Server instance, set the org.kie.prometheus.server.ext.disabled system property to false to enable the Prometheus extension. You can define this property when you start KIE Server or in the standalone.xml or standalone-full.xml file of the jBPM distribution.
  2. If you are running jBPM on Spring Boot, configure the required key in the application.properties system property:
    Spring Boot application.properties key for jBPM and Prometheus
  3. In the prometheus.yaml file of your Prometheus distribution, add the following settings in the scrape_configs section to configure Prometheus to scrape metrics from KIE Server:
    Scrape configurations in prometheus.yaml file
    Scrape configurations in prometheus.yaml file for Spring Boot (if applicable)
    Replace the values according to your KIE Server location and settings.
  4. Start the KIE Server instance. After you start the configured KIE Server instance, Prometheus begins collecting metrics and KIE Server publishes the metrics to the REST API endpoint http://HOST:PORT/SERVER/services/rest/metrics (or on Spring Boot, to http://HOST:PORT/rest/metrics).
  5. In a REST client or curl utility, send a REST API request with the following components to verify that KIE Server is publishing the metrics: For REST client:
    • Authentication: Enter the user name and password of the KIE Server user with the kie-server role.
    • HTTP Headers: Set the following header:
      • Accept: application/json
    • HTTP method: Set to GET.
    • URL: Enter the KIE Server REST API base URL and metrics endpoint, such as http://localhost:8080/kie-server/services/rest/metrics (or on Spring Boot, http://localhost:8080/rest/metrics).
    For curl utility:
    • -u: Enter the user name and password of the KIE Server user with the kie-server role.
    • -H: Set the following header:
      • accept: application/json
    • -X: Set to GET.
    • URL: Enter the KIE Server REST API base URL and metrics endpoint, such as http://localhost:8080/kie-server/services/rest/metrics (or on Spring Boot, http://localhost:8080/rest/metrics).
    Example curl command for jBPM on Wildfly
    Example curl command for jBPM on Spring Boot
    Example server response
    If the metrics are not available in KIE Server, review and verify the KIE Server and Prometheus configurations described in this section. You can also interact with your collected metrics in the Prometheus expression browser at http://HOST:PORT/graph, or integrate your Prometheus data source with a data-graphing tool such as Grafana: prometheus expression browser data Prometheus expression browser with KIE Server metrics prometheus expression browser targets Prometheus expression browser with KIE Server target prometheus grafana data dmn Grafana dashboard with KIE Server metrics for DMN models prometheus grafana data optimizer Grafana dashboard with KIE Server metrics for solvers prometheus grafana data jbpm Grafana dashboard with KIE Server metrics for processes, cases, and tasks
Additional resources

Extending Prometheus metrics monitoring in KIE Server with custom metrics

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. As an example, this procedure defines custom Decision Model and Notation (DMN) metrics to be collected and stored by Prometheus. Prerequisites Procedure
  1. Create an empty Maven project and define the following packaging type and dependencies in the pom.xml file for the project:
    Example pom.xml file in the sample project
  2. Implement the relevant listener from the org.kie.server.services.prometheus.PrometheusMetricsProvider interface as part of the custom listener class that defines your custom Prometheus metrics, as shown in the following example:
    Sample implementation of the DMNRuntimeEventListener listener in a custom listener class
    The PrometheusMetricsProvider interface contains the required listeners for collecting Prometheus metrics. The interface is incorporated by the kie-server-services-prometheus dependency that you declared in your project pom.xml file. In this example, the ExampleCustomPrometheusMetricListener class implements the DMNRuntimeEventListener listener (from the PrometheusMetricsProvider interface) and defines the custom DMN metrics to be collected and stored by Prometheus.
  3. Implement the PrometheusMetricsProvider interface as part of a custom metrics provider class that associates your custom listener with the PrometheusMetricsProvider interface, as shown in the following example:
    Sample implementation of the PrometheusMetricsProvider interface in a custom metrics provider class
    In this example, the MyPrometheusMetricsProvider class implements the PrometheusMetricsProvider interface and includes your custom ExampleCustomPrometheusMetricListener listener class.
  4. To make the new metrics provider discoverable for KIE Server, create a META-INF/services/org.kie.server.services.prometheus.PrometheusMetricsProvider file in your Maven project and add the fully qualified class name of the PrometheusMetricsProvider implementation class within the file. For this example, the file contains the single line org.kie.server.ext.prometheus.MyPrometheusMetricsProvider.
  5. Build your project and copy the resulting JAR file into the ~/kie-server.war/WEB-INF/lib directory of your project.
  6. Start the KIE Server and deploy the built project to the running KIE Server. You can deploy the project using the Business Central interface or the KIE Server REST API (a PUT request to http://SERVER:PORT/kie-server/services/rest/server/containers/{containerId}). After your project is deployed on a running KIE Server, Prometheus begins collecting metrics and KIE Server publishes the metrics to the REST API endpoint http://HOST:PORT/SERVER/services/rest/metrics (or on Spring Boot, to http://HOST:PORT/rest/metrics).