Before the JBoss agent can
gather JBoss server web metrics and other subsystem metrics, statistics collection must be enabled
for each subsystem. This procedure is for JBoss EAP version 7.x and WildFly versions 8.x, 9.x and
10.x.
Procedure
The statistics-enabled attribute of various JBoss subsystems
controls statistic collection. This setting can be viewed and updated by using the JBoss command
line interface.
Note: This procedure is for JBoss EAP version 7.x and WildFly versions 8.x, 9.x and
10.x.
-
Go to the binary or bin directory under the JBoss server installation
directory.
-
Start the JBoss command line interface.
./jboss-cli.sh
--connect
[--controller=IP:port]
jboss-cli.bat
--connect
[--controller=IP:port]
where IP is the JBoss server's IP address and port is the
JBoss server's port. For example,
192.168.10.20:9990.
Tip: If the connection attempt results in the error,
Failed to connect to the
controller: The controller is not available at localhost:9990: java.net.ConnectException:
WFLYPRT0053: Could not connect to http-remoting://localhost:9990. The connection failed:
WFLYPRT0053: Could not connect to http-remoting://localhost:9990. The connection failed: Connection
refused
, use the
--controller parameter.
This error indicates
that the management server is not listening on the localhost IP address (127.0.0.1) and is
configured to listen on the computer's IP address.
-
Run the following commands to view the current state of each subsystem's statistics-enabled
attribute:
Note: If JBoss is running in Domain Mode, each command must be prefixed with the associated profile
and these commands must be run for each monitored profile. For example:
/profile=full/subsystem=ejb3:read-attribute(name=statistics-enabled)
/subsystem=ejb3:read-attribute(name=enable-statistics)
/subsystem=transactions:read-attribute(name=statistics-enabled)
/subsystem=undertow:read-attribute(name=statistics-enabled)
/subsystem=webservices:read-attribute(name=statistics-enabled)
/subsystem=datasources/data-source=Data_Source_Name:read-attribute(name=statistics-enabled)
/subsystem=datasources/data-source=Data_Source_Name/statistics=pool:read-attribute(name=statistics-enabled)
/subsystem=datasources/data-source=Data_Source_Name/statistics=jdbc:read-attribute(name=statistics-enabled)
where Data_Source_Name is the name of a data source that is configured for use
with JBoss.
Note: Data sources can be listed by using the command
/subsystem=datasources:read-resource
.
Example result when statistics are not
enabled:
{
"outcome" => "success",
"result" => false
}
-
Run the following command to change the value of each subsystem's statistics-enabled attribute
to true:
/subsystem=ejb3:write-attribute(name=enable-statistics, value=true)
/subsystem=transactions:write-attribute(name=statistics-enabled,value=true)
/subsystem=undertow:write-attribute(name=statistics-enabled,value=true)
/subsystem=webservices:write-attribute(name=statistics-enabled,value=true)
/subsystem=datasources/data-source=Data_Source_Name:write-attribute(name=statistics-enabled,value=true)
/subsystem=datasources/data-source=Data_Source_Name/statistics=pool:write-attribute(name=statistics-enabled,value=true)
/subsystem=datasources/data-source=Data_Source_Name/statistics=jdbc:write-attribute(name=statistics-enabled,value=true)
Example result when you enable statistics for a
subsystem:
{
"outcome" => "success",
"response-headers" => {
"operation-requires-reload" => true,
"process-state" => "reload-required"
}
}
- Exit the JBoss command line interface.
- Restart the JBoss server.
Note: Any currently running JBoss agents with transaction tracking enabled must be restarted.