Knowledge Base

cancel
Showing results for 
Search instead for 
Did you mean: 

How do I get JMX Metrics for Database Connections on GlassFish?

JDBC connection pool metrics are not configured out-of-the-box for GlassFish.

 

To configure them, uncomment the JDBC connection pool section and provide the relevant information in the following file:

 

<agent_home>/ver<version_number>/conf/jmx/servers/glassfish-v2-jmx-config.xml

 

Uncomment the following section and follow the instructions provided in the file.

<!-- The following config can be uncommented to monitor glassfish JDBC connection pool. Please set the name of the connection pool (not the datasource name) and enable monitoring for the JDBC Pools on glassfish admin console. -->
<!--
<metric mbean-name-pattern="com.sun.appserv:type=jdbc-connection-pool,category=monitor,name=<set the name of pool>,*"
category="JDBC Connection Pools">
<attribute-counter-mappings>
<attribute-counter-mapping>
<attribute-name>numconnused-current</attribute-name>
<counter-name>Connections In Use</counter-name>
<counter-type>average</counter-type>
<time-rollup-type>average</time-rollup-type>
<cluster-rollup-type>individual</cluster-rollup-type>
</attribute-counter-mapping>
<attribute-counter-mapping>
<attribute-name>numconnused-highwatermark</attribute-name>
<counter-name>Max Connections Used</counter-name>
<counter-type>observation</counter-type>
<time-rollup-type>average</time-rollup-type>
<cluster-rollup-type>individual</cluster-rollup-type>
</attribute-counter-mapping>
<attribute-counter-mapping>
<attribute-name>numpotentialconnleak-count</attribute-name>
<counter-name>Potential Leaks</counter-name>
<counter-type>observation</counter-type>
<time-rollup-type>average</time-rollup-type>
<cluster-rollup-type>individual</cluster-rollup-type>
</attribute-counter-mapping>
<attribute-counter-mapping>
<attribute-name>averageconnwaittime-count</attribute-name>
<counter-name>Avg Wait Time Millis</counter-name>
<counter-type>observation</counter-type>
<time-rollup-type>average</time-rollup-type>
<cluster-rollup-type>individual</cluster-rollup-type>
</attribute-counter-mapping>
<attribute-counter-mapping>
<attribute-name>waitqueuelength-count</attribute-name>
<counter-name>Current Wait Queue Length</counter-name>
<counter-type>observation</counter-type>
<time-rollup-type>average</time-rollup-type>
<cluster-rollup-type>individual</cluster-rollup-type>
</attribute-counter-mapping>
</attribute-counter-mappings>
</metric>
Version history
Revision #:
3 of 3
Last update:
‎02-21-2019 09:39 AM
Updated by:
 
Labels (1)
Contributors


Found this article helpful? Click the Thumbs Up button.
Have an additional comment? Post it below.
0 Kudos