Chapter 22. Process monitoring

22.1. JBoss Operations Network

You can use a JBoss Operations Network plug-in to monitor rule sessions in Red Hat JBoss BPM Suite.

Due to a limitation of passing the JVM monitoring arguments via the Maven command line, all com.sun.management.jmxremote.* parameters must be passed to the Red Hat JBoss BPM Suite application via the pom.xml configuration file.

See the Installation Guide of Red Hat JBoss Operations Network for installation instructions on the Red Hat JBoss ON server.

22.2. Supported services with JBoss Operations Network

The services supported by JBoss Operations Network are listed in the rhq-plugin.xml file in the relevant JBoss Operations Network plug-in or distribution. For example, in the JBoss BRMS plug-in pack jon-plugin-pack-brms-bpms-3.3.0.GA, you can view all supported services and corresponding operations and metrics in drools-rhq-plugin-6.5.0.Final-redhat-2.jar/META-INF/rhq-plugin.xml:

Example rhq-plugin.xml file for the JBoss BRMS plug-in with supported services

...

<service name="Kie Containers"
        description="The Kie Container monitoring service."
        discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
        class="org.rhq.plugins.jmx.MBeanResourceComponent">

          <runs-inside>
             <parent-resource-type name="JMX Server" plugin="JMX"/>
          </runs-inside>

          <plugin-configuration>
             <c:simple-property name="objectName" readOnly="true" default="org.kie:kcontainerId=%kcontainerId%"/>
             <c:simple-property name="nameTemplate" readOnly="true" default="KieContainer {kcontainerId}"/>
             <c:simple-property name="descriptionTemplate" readOnly="true" default="A JMX bean for Kie Container {kcontainerId}"/>
             <c:simple-property name="kcontainerId" type="string" readOnly="true" description="The Kie Container Id"/>
          </plugin-configuration>

        <metric property="ConfiguredReleaseIdStr"
                description="The RelaseId configured while creating the KieContainer"
                displayName="Configured ReleaseId"
                dataType="trait"
                displayType="summary" />

        <metric property="ResolvedReleaseIdStr"
                description="The actual resolved ReleaseId"
                displayName="Resolved ReleaseId"
                dataType="trait"
                displayType="summary" />

       <service name="Kie Bases"
                description="The Kie Base monitoring service."
                discovery="org.drools.rhq.plugin.ExposeKCIDValueFromParentDiscoveryComponent"
                class="org.rhq.plugins.jmx.MBeanResourceComponent">

          <plugin-configuration>
             <c:simple-property name="objectName" readOnly="true" default="org.kie:kcontainerId={kcontainerId},kbaseId=%kbaseId%"/>
             <c:simple-property name="nameTemplate" readOnly="true" default="KieBase {kbaseId}"/>
             <c:simple-property name="descriptionTemplate" readOnly="true" default="A JMX bean for Kie Base {kbaseId}"/>
             <c:simple-property name="kbaseId" type="string" readOnly="true" description="The Kie Base Id"/>
          </plugin-configuration>

          <operation name="startInternalMBeans"
                     displayName="Start Internal MBeans"
                     description="Starts all the internal dependent MBeans.">
          </operation>

          <operation name="stopInternalMBeans"
                     displayName="Stop Internal MBeans"
                     description="Stops all the internal dependent MBeans.">
          </operation>

           <service name="Kie Sessions"
                    description="The Kie Session monitoring service."
                    discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
                    class="org.rhq.plugins.jmx.MBeanResourceComponent">

              <plugin-configuration>
                 <c:simple-property name="objectName" readOnly="true" default="org.kie:kcontainerId={kcId},kbaseId={kbaseId},ksessionType=Stateful,ksessionName=%sessionId%"/>
                 <c:simple-property name="nameTemplate" readOnly="true" default="KieSession {sessionId}"/>
                 <c:simple-property name="descriptionTemplate" readOnly="true" default="A JMX bean for Kie Base {kbaseId}, Kie session {sessionId}"/>
                 <c:simple-property name="kbaseId" type="string" readOnly="true" description="The Kie Base Id"/>
                 <c:simple-property name="sessionId" type="string" readOnly="true" description="The Kie Session Id"/>
              </plugin-configuration>

              <operation name="reset" displayName="Reset Metrics" description="Reset all metric counters."/>

              <operation name="getStatsForRule"
                         displayName="Get statistics for rule"
                         description="Get and return the statistics for a specific rule.">
                  <parameters>
                      <c:simple-property name="ruleName" displayName="Rule Name" required="true"/>
                  </parameters>
                  <results>
                      <c:simple-property name="stats"/>
                  </results>
              </operation>

              <operation name="getStatsForProcess"
                         displayName="Get statistics for process"
                         description="Get and return the statistics for a specific process.">
                  <parameters>
                      <c:simple-property name="processId" displayName="Process ID" required="true"/>
                  </parameters>
                  <results>
                      <c:simple-property name="stats"/>
                  </results>
              </operation>

              <metric displayName="Total Fact Count" property="TotalFactCount"
                      description="The total number of facts in memory"
                      category="utilization" displayType="summary" measurementType="dynamic"/>

              <metric displayName="Total Matches Created" property="TotalMatchesCreated"
                      description="The total number of matches created since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Matches Fired" property="TotalMatchesFired"
                      description="The total number of matches fired since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Matches Cancelled" property="TotalMatchesCancelled"
                      description="The total number of matches cancelled since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Firing Time" property="TotalFiringTime" units="milliseconds"
                      description="The total time spent firing rules since reset"
                      category="performance" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Process Instances Started" property="TotalProcessInstancesStarted"
                      description="The total number of process instances started since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Process Instances Completed" property="TotalProcessInstancesCompleted"
                      description="The total number of process instances completed since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric property="LastReset"
                      description="The timestamp of the last reset operation"
                      displayName="Last Reset"
                      dataType="trait"
                      displayType="summary" />

           </service>  <!-- /Kie Sessions -->

           <service name="Stateless Kie Sessions"
                    description="The stateless Kie Session monitoring service."
                    discovery="org.rhq.plugins.jmx.MBeanResourceDiscoveryComponent"
                    class="org.rhq.plugins.jmx.MBeanResourceComponent">

              <plugin-configuration>
                 <c:simple-property name="objectName" readOnly="true" default="org.kie:kcontainerId={kcId},kbaseId={kbaseId},ksessionType=Stateless,ksessionName=%sessionId%"/>
                 <c:simple-property name="nameTemplate" readOnly="true" default="KieSession {sessionId}"/>
                 <c:simple-property name="descriptionTemplate" readOnly="true" default="A JMX bean for Kie Base {kbaseId}, Kie session {sessionId}"/>
                 <c:simple-property name="kbaseId" type="string" readOnly="true" description="The Kie Base Id"/>
                 <c:simple-property name="sessionId" type="string" readOnly="true" description="The Kie Session Id"/>
              </plugin-configuration>

              <operation name="reset" displayName="Reset Metrics" description="Reset all metric counters."/>

              <operation name="getStatsForRule"
                         displayName="Get statistics for rule"
                         description="Get and return the statistics for a specific rule.">
                  <parameters>
                      <c:simple-property name="ruleName" displayName="Rule Name" required="true"/>
                  </parameters>
                  <results>
                      <c:simple-property name="stats"/>
                  </results>
              </operation>

              <operation name="getStatsForProcess"
                         displayName="Get statistics for process"
                         description="Get and return the statistics for a specific process.">
                  <parameters>
                      <c:simple-property name="processId" displayName="Process ID" required="true"/>
                  </parameters>
                  <results>
                      <c:simple-property name="stats"/>
                  </results>
              </operation>

              <metric displayName="Total Objects Inserted" property="TotalObjectsInserted"
                      description="The total number of objects inserted on all sessions"
                      category="throughput" displayType="summary" measurementType="trendsup"/>
              <metric displayName="Total Objects Deleted" property="TotalObjectsDeleted"
                      description="The total number of objects deleted on all sessions"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Matches Created" property="TotalMatchesCreated"
                      description="The total number of matches created since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Matches Fired" property="TotalMatchesFired"
                      description="The total number of matches fired since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Matches Cancelled" property="TotalMatchesCancelled"
                      description="The total number of matches cancelled since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Firing Time" property="TotalFiringTime" units="milliseconds"
                      description="The total time spent firing rules since reset"
                      category="performance" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Process Instances Started" property="TotalProcessInstancesStarted"
                      description="The total number of process instances started since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric displayName="Total Process Instances Completed" property="TotalProcessInstancesCompleted"
                      description="The total number of process instances completed since reset"
                      category="throughput" displayType="summary" measurementType="trendsup"/>

              <metric property="LastReset"
                      description="The timestamp of the last reset operation"
                      displayName="Last Reset"
                      dataType="trait"
                      displayType="summary" />

           </service>  <!-- /Stateless Kie Sessions -->

       </service>  <!-- /Kie Bases -->

     </service>  <!-- /Kie Containers -->

This example rhq-plugin.xml file for the JBoss BRMS plug-in contains the following services:

  • Kie Containers
  • Kie Bases
  • Kie Sessions
  • Stateless Kie Sessions

Each service contains operations and metrics that can be monitored as part of the service. For example, the Kie Sessions service supports the operations reset, getStatsForRule, and getStatsForProcess, and supports metrics such as Total Fact Count, Total Matches Created, and Total Matches Fired.

The specific services supported depend on the JBoss Operations Network plug-in or distribution that you use.

22.3. Installing the JBoss BRMS Plug-in into JBoss ON

You can install the Red Hat JBoss BRMS plug-in for JBoss Operations Network either by copying the plug-in JAR files to the JBoss Operations Network plug-in directory or through the JBoss Operations Network GUI.

To copy the plug-in JAR files to the JBoss Operations Network plug-in directory, use the following procedure:

Procedure: Copying the JBoss BRMS plug-in JAR files

  1. Extract the JBoss BRMS plug-in pack archive to a temporary location. This creates a subdirectory with the name jon-plugin-pack-brms-bpms-3.3.0.GA. For example:

    [root@server rhq-agent]# unzip jon-plugin-pack-brms-bpms-3.3.0.GA.zip -d /tmp
  2. Copy the extracted JBoss BRMS plug-in JAR files from the jon-plugin-pack-brms-bpms-3.3.0.GA/ directory to the JBoss ON server plug-in directory. For example:

    [root@server rhq-agent]# cp /tmp/jon-plugin-pack-brms-bpms-3.3.0.GA/*.jar /opt/jon/jon-server-3.3.0.GA/plugins
  3. Start the JBoss Operations Network server to update the JBoss BRMS plug-in.

To upload the JBoss BRMS plug-in through the JBoss Operations Network GUI, use the following procedure:

Procedure: Uploading the JBoss BRMS plug-in through GUI

  1. Start the JBoss Operations Network Server and Log in to access the GUI.
  2. In the top navigation of the GUI, open the Administration menu.
  3. In the Configuration area on the left, select the Agent Plugins link.
  4. At the bottom of the list of loaded agent plug-ins, click the Upload a plugin button and choose the BRMS plugin.
  5. The JBoss BRMS plug-in for JBoss Operations Network is now uploaded.

22.4. Monitoring Kie Bases and Kie Sessions

In order for JBoss Operations Network to monitor KieBases and KieSessions, MBeans must be enabled.

MBeans can be enabled either by passing the parameter: -kie.mbeans = enabled or via the API:

KieBaseConfiguration kbconf = KieServices.Factory.get().newKieBaseConfiguration();
kbconf.setOption(MBeansOption.ENABLED);
Note

Kie Services have been implemented for JBoss BRMS 6; for JBoss BRMS 5, Drools Services was the naming convention used and it had different measurements on sessions. For example, activationmatch renaming occurred in the updated version.

Please refer to the Resource Monitoring and Operations Reference guide of the Red Hat JBoss Operations Network for information on importing Kie Sessions into the Inventory View for monitoring purposes.