JVM metrics page

You can use New Relic's Java agent to collect and view additional metrics provided by the most common application servers via JMX. The collected metrics vary by application server and include measurements of thread pools, HTTP sessions, and transactions.

Access to this feature depends on your subscription level.

Viewing JVM metrics

Application servers collect and report different metrics which appear on New Relic APM's JVM page. At a minimum, each application server collects and reports metric data on memory. For instructions on enabling JMX metrics, refer to your application server's documentation.

For applications using New Relic via Heroku, the JVM page is named Instances.

To view JVM metrics:

  1. Go to rpm.newrelic.com/apm > (select an app) > Monitoring > JVMs > (select a JVM).
  2. From the selected JVM's Memory page, use any of New Relic's standard user interface functions to drill down into detailed information.
  3. To view other metrics, select any available tab.
  4. Optional: To use the thread profiler to look for bottlenecks in data on executing threads, select Profile this JVM.
JVM-new-tabset.png
rpm.newrelic.com/apm > (select an app) > Monitoring > JVMs: Depending on the metrics your application server is reporting, one or more tabs appear on your JVM page.

Tabs available by app server

The following table lists which tabs appear on the JVM page for application servers. If your application server does not report a particular type of metric data, the tab does not appear on your JVM page.

App Server Memory Thread pools HTTP Sessions App Server Transactions
Glassfish [check] [check] [check] [check]
JBoss 5AS [check] [check] [check]
JBoss 6AS [check] [check] [check]
JBoss 6EAP [check] [check]
JBoss 7AS [check] [check]
Jetty [check] [check]
Resin 3 [check] [check] [check]
Resin 4 [check] [check] [check] [check]
Tomcat [check] [check] [check]
TomEE [check] [check] [check]
WebLogic [check] [check]
Websphere [check] [check] [check]

Metrics available by tab

Here is a summary of the metrics available from the JVM page. If the application server does not support a particular metric, that tab does not appear on your JVM page.

JMX Metric charts
Memory
  • Heap memory usage: Each chart shows the used and committed heap space in MB for a given heap.
  • Non-heap memory pool usage for the JVM: The used code cache and used CMS Perm Gen in MB.
  • Garbage collection: The garbage collection CPU time.
  • Class count: The loaded and unloaded class count for the JVM.
Threads
  • Thread count: The current number of active threads in the JVM.
  • Thread pool: The active and idle thread count for the pool. On supported application servers, a chart shows each thread pool present in the application server, as well as the ratio of active to maximum thread count for each thread pool.
HTTP sessions
  • Session: The active, expired, and rejected HTTP session counts for the application. On supported application servers, a chart shows each application present in the application server.
App server transactions
  • Active transaction: The number of active transactions within the application server's transaction manager.
  • Created transaction: The change in the total number of created transactions per application server. Some application servers separate top level transactions and nested transactions.
  • Finished transaction: The change in the total number of finished transactions per application server. Some application servers separate them by aborted and committed completed transactions.

WebSphere PMI metrics

To enable New Relic to access WebSphere PMI metrics you will need to configure WebSphere to monitor the necessary statistic sets.

Enable all statistic sets (recommended)

The simplest approach is to enable the collection of all statistic sets:

  1. If you are using Java 2 Security, ensure you have granted New Relic proper permissions.
  2. From the WebSphere admin console, select Monitoring and Tuning > Performance Monitoring Infrastructure (PMI) > (your server name).

    screen-websphere-pmi-metrics.png
    WebSphere Admin Console > Monitoring and Tuning > Performance Monitoring Infrastructure: To configure statistic sets, select your server name from the Performance Monitoring Infrastructure panel.
  3. Select the Enable Performance Monitoring Infrastructure (PMI) checkbox.
  4. In the Currently monitored statistic set section, select All.

    screen-websphere-select-all.png
    WebSphere Admin Console > Monitoring and Tuning > Performance Monitoring Infrastructure > (selected server): Select Enable Performance Monitoring and All to enable all PMI metrics.
  5. Select Apply to save your changes
Enable custom statistic sets (advanced)

You can also collect only the PMI metrics that New Relic monitors by default. To collect only some PMI metrics:

  1. If you are using Java 2 Security, ensure you have granted New Relic proper permissions.
  2. From the WebSphere admin console, select Monitoring and Tuning > Performance Monitoring Infrastructure (PMI) > (your server name).

    screen-websphere-pmi-metrics.png
    WebSphere Admin Console > Monitoring and Tuning > Performance Monitoring Infrastructure: To configure statistic sets, select your server name from the Performance Monitoring Infrastructure panel.
  3. Select the Enable Performance Monitoring Infrastructure (PMI) checkbox.
  4. Select Custom. From the custom statistic set list, enable the following metrics:
    1. In the ThreadPool category, select the ActiveCount and PoolSize checkboxes. Select Enable.
    2. In the Servlet Session Manager category, select the ActiveCount and LiveCount checkboxes. Select Enable.
    3. In the Transaction Manager category, select the CommittedCount, RolledbackCount, and GlobalTimeoutCount checkboxes. Select Enable.
  5. From the Messages panel, select Save directly to the master configuration to save your changes

When enabled, New Relic collects the following WebSphere PMI metrics:

stats.ActiveCount
Attribute stats.ActiveCount
Object name pattern
WebSphere:type=ThreadPool,name=*,process=*,platform=*,node=*,*
New Relic metric
JmxBuiltIn/ThreadPool/WebContainer/Active
Type Simple
maximumSize
Attribute maximumSize
Object name pattern
WebSphere:type=ThreadPool,name=*,process=*,platform=*,node=*,*
New Relic metric
JmxBuiltIn/ThreadPool/WebContainer/Max
Type Simple
stats.CommittedCount
Attribute stats.CommittedCount
Object name pattern
WebSphere:j2eeType=JTAResource,type=TransactionService,name=*,process=*,platform=*,node=*,*
New Relic metric
JmxBuiltIn/JTA/TransactionService/Committed
Type Simple
stats.RolledbackCount
Attribute stats.RolledbackCount
Object name pattern
WebSphere:j2eeType=JTAResource,type=TransactionService,name=*,process=*,platform=*,node=*,*
New Relic metric
JmxBuiltIn/JTA/TransactionService/Rolled Back
Type Simple
stats.GlobalTimeoutCount
Attribute stats.GlobalTimeoutCount
Object name pattern
WebSphere:j2eeType=JTAResource,type=TransactionService,name=*,process=*,platform=*,node=*,*
New Relic metric
JmxBuiltIn/JTA/TransactionService/Timed Out
Type Simple
stats.LiveCount
Attribute stats.GlobalTimeoutCount
Object name pattern
WebSphere:type=SessionManager,name=*,process=*,platform=*,node=*,*
New Relic metric
JmxBuiltIn/Session/DefaultApplication#DefaultWebApplication.war/Active
Type Simple

WebLogic JMX Metrics

In WebLogic, JMX is enabled by default. New Relic collects the following mbeans metrics:

To collect additional JMX metrics, use a custom YAML file.

ThreadCount
Attribute ThreadCount
Object name pattern
java.lang:type=Threading
New Relic metric
JmxBuiltIn/Threads/Thread Count
Type Simple
TotalStartedThreadCount
Attribute TotalStartedThreadCount
Object name pattern
java.lang:type=Threading
New Relic metric
JmxBuiltIn/Threads/TotalStartedCount
Type Simple
LoadedClassCount
Attribute LoadedClassCount
Object name pattern
java.lang:type=ClassLoading
New Relic metric
JmxBuiltIn/Classes/Loaded
Type Simple
UnloadedClassCount
Attribute UnloadedClassCount
Object name pattern
java.lang:type=ClassLoading
New Relic metric
JmxBuiltIn/Classes/Unloaded
Type Simple
HoggingThreadCount
Attribute HoggingThreadCount
Object name pattern
com.bea:ServerRuntime=*,Name=ThreadPoolRuntime,Type=ThreadPoolRuntime
New Relic metric
JmxBuiltIn/ThreadPool/{Name}/Active
Type Simple
ExecuteThreadIdleCount
Attribute ExecuteThreadIdleCount
Object name pattern
com.bea:ServerRuntime=*,Name=ThreadPoolRuntime,Type=ThreadPoolRuntime
New Relic metric
JmxBuiltIn/ThreadPool/{Name}/Idle
Type Simple
StandbyThreadCount
Attribute StandbyThreadCount
Object name pattern
com.bea:ServerRuntime=*,Name=ThreadPoolRuntime,Type=ThreadPoolRuntime
New Relic metric
JmxBuiltIn/ThreadPool/{Name}/Standby
Type Simple
TransactionTotalCount
Attribute TransactionTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=JTARuntime,Type=JTARuntime
New Relic metric
JmxBuiltIn/JTA/{Name}/Count
Type Monotonic
TransactionCommittedTotalCount
Attribute TransactionCommittedTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=JTARuntime,Type=JTARuntime
New Relic metric
JmxBuiltIn/JTA/{Name}/Committed
Type Monotonic
TransactionRolledBackTotalCount
Attribute TransactionRolledBackTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=JTARuntime,Type=JTARuntime
New Relic metric
JmxBuiltIn/JTA/{Name}/Rolled Back
Type Monotonic
TransactionAbandonedTotalCount
Attribute TransactionAbandonedTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=JTARuntime,Type=JTARuntime
New Relic metric
JmxBuiltIn/JTA/{Name}/Abandoned
Type Monotonic
NumAvailable
Attribute NumAvailable
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Connections/Available
Type Simple
CurrCapacity
Attribute CurrCapacity
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Connections/PoolSize
Type Simple
ConnectionsTotalCount
Attribute ConnectionsTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Connections/Created
Type Monotonic
ActiveConnectionsCurrentCount
Attribute ActiveConnectionsCurrentCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Connections/Active
Type Simple
LeakedConnectionCount
Attribute LeakedConnectionCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Connections/Leaked
Type Monotonic
PrepStmtCacheCurrentSize
Attribute PrepStmtCacheCurrentSize
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Statement Cache/Size
Type Simple
WaitingForConnectionCurrentCount
Attribute WaitingForConnectionCurrentCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Requests/Currently Waiting
Type Simple
WaitingForConnectionTotal
Attribute WaitingForConnectionTotal
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Requests/Count
Type Monotonic
WaitingForConnectionSuccessTotal
Attribute WaitingForConnectionSuccessTotal
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Requests/Successful
Type Monotonic
WaitingForConnectionFailureTotal
Attribute WaitingForConnectionFailureTotal
Object name pattern
com.bea:ServerRuntime=*,Name=*,Type=JDBCDataSourceRuntime
New Relic metric
JmxBuiltIn/DataSources/{Name}/Requests/Failed
Type Monotonic
AccessTotalCount - MissTotalCount
Attribute AccessTotalCount - MissTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Attempts/Successful
Type Monotonic
MissTotalCount
Attribute MissTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Attempts/Failed
Type Monotonic
WaiterCurrentCount
Attribute WaiterCurrentCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Threads/Waiting
Type Simple
DestroyedTotalCount
Attribute DestroyedTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Beans/Destroyed
Type Monotonic
BeansInUseCurrentCount
Attribute BeansInUseCurrentCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Beans/Active
Type Simple
PooledBeansCurrentCount
Attribute PooledBeansCurrentCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBPoolRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Pool/Bean/{ApplicationRuntime}/{EJBComponentRuntime}/{Name}/Beans/Available
Type Simple
TransactionsCommittedTotalCount +TransactionsRolledBackTotalCount +TransactionsTimedOutTotalCount
Attribute TransactionsCommittedTotalCount +TransactionsRolledBackTotalCount +TransactionsTimedOutTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBTransactionRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Transactions/Application/{ApplicationRuntime}/Count
Type Monotonic
TransactionsCommittedTotalCount
Attribute TransactionsCommittedTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBTransactionRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Transactions/Application/{ApplicationRuntime}/Committed
Type Monotonic
TransactionsRolledBackTotalCount
Attribute TransactionsRolledBackTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBTransactionRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Transactions/Application/{ApplicationRuntime}/Rolled Back
Type Monotonic
TransactionsTimedOutTotalCount
Attribute TransactionsTimedOutTotalCount
Object name pattern
com.bea:ServerRuntime=*,Name=*,ApplicationRuntime=*,Type=EJBTransactionRuntime,EJBComponentRuntime=*,*
New Relic metric
JmxBuiltIn/EJB/Transactions/Application/{ApplicationRuntime}/Timed Out
Type Monotonic

If you want other PMI metrics besides these to be displayed in Custom Dashboards, they will need to be manually collected using JMX instrumentation.

For more help

Additional documentation resources include:

Join the discussion about Java monitoring in the New Relic Online Technical Community! The Technical Community is a public platform to discuss and troubleshoot your New Relic toolset.

If you need additional help, get support at support.newrelic.com.