11.2. Configuring Prometheus metrics monitoring for KIE Server on Red Hat OpenShift Container Platform
You can configure your KIE Server deployment on Red Hat OpenShift Container Platform to use Prometheus to collect and store metrics related to your business asset activity in Red Hat Decision Manager. For the list of available metrics that KIE Server exposes with Prometheus, download the Red Hat Decision Manager 7.10.0 Source Distribution from the Red Hat Customer Portal and navigate to ~/rhdm-7.10.0-sources/src/droolsjbpm-integration-$VERSION/kie-server-parent/kie-server-services/kie-server-services-prometheus/src/main/java/org/kie/server/services/prometheus
.
Prerequisites
- KIE Server is installed and deployed on Red Hat OpenShift Container Platform. For more information about KIE Server on OpenShift, see the relevant OpenShift deployment option in the Product documentation for Red Hat Decision Manager 7.10.
-
You have
kie-server
user role access to KIE Server. - Prometheus Operator is installed. For information about downloading and using Prometheus Operator, see the Prometheus Operator project in GitHub.
Procedure
In the
DeploymentConfig
object of your KIE Server deployment on OpenShift, set thePROMETHEUS_SERVER_EXT_DISABLED
environment variable tofalse
to enable the Prometheus extension. You can set this variable in the OpenShift web console or use theoc
command in a command terminal:oc set env dc/<dc_name> PROMETHEUS_SERVER_EXT_DISABLED=false -n <namespace>
oc set env dc/<dc_name> PROMETHEUS_SERVER_EXT_DISABLED=false -n <namespace>
Copy to Clipboard Copied! Toggle word wrap Toggle overflow If you have not yet deployed your KIE Server on OpenShift, then in the OpenShift template that you plan to use for your OpenShift deployment (for example,
rhdm710-prod-immutable-kieserver.yaml
), you can set thePROMETHEUS_SERVER_EXT_DISABLED
template parameter tofalse
to enable the Prometheus extension.If you are using the OpenShift Operator to deploy KIE Server on OpenShift, then in your KIE Server configuration, set the
PROMETHEUS_SERVER_EXT_DISABLED
environment variable tofalse
to enable the Prometheus extension:Copy to Clipboard Copied! Toggle word wrap Toggle overflow Create a
service-metrics.yaml
file to add a service that exposes the metrics from KIE Server to Prometheus:Copy to Clipboard Copied! Toggle word wrap Toggle overflow In a command terminal, use the
oc
command to apply theservice-metrics.yaml
file to your OpenShift deployment:oc apply -f service-metrics.yaml
oc apply -f service-metrics.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow -
Create an OpenShift secret, such as
metrics-secret
, to access the Prometheus metrics on KIE Server. The secret must contain the "username" and "password" elements with KIE Server user credentials. For information about OpenShift secrets, see the Secrets chapter in the OpenShift Developer Guide. Create a
service-monitor.yaml
file that defines theServiceMonitor
object. A service monitor enables Prometheus to connect to the KIE Server metrics service.Copy to Clipboard Copied! Toggle word wrap Toggle overflow In a command terminal, use the
oc
command to apply theservice-monitor.yaml
file to your OpenShift deployment:oc apply -f service-monitor.yaml
oc apply -f service-monitor.yaml
Copy to Clipboard Copied! Toggle word wrap Toggle overflow After you complete these configurations, Prometheus begins collecting metrics and KIE Server publishes the metrics to the REST API endpoint
http://HOST:PORT/kie-server/services/rest/metrics
.You can 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.The host and port for the Prometheus expression browser location
http://HOST:PORT/graph
was defined in the route where you exposed the Prometheus web console when you installed the Prometheus Operator. For information about OpenShift routes, see the Routes chapter in the OpenShift Architecture documentation.図11.5 Prometheus expression browser with KIE Server metrics
図11.6 Prometheus expression browser with KIE Server target
図11.7 Grafana dashboard with KIE Server metrics for DMN models
図11.8 Grafana dashboard with KIE Server metrics for solvers
Additional resources