Monitoring iObeya using JMX

Overview

This section describes how to expose JMX Mbeans within iObeya for monitoring with a JMX interface.

Java Management Extensions (JMX) is a tool for managing and monitoring Java applications and services. By exposing data and resources through objects called Mbeans (Managed Beans), JMX allows you to keep a close eye on your instance and make informed decisions for optimization and maintenance.

Enabling JMX on Tomcat

Before being able to connect a JMX console to iObeya, it must be enabled by specifying the following command line options for Tomcat (environment variable is CATALINA_OPTS in setenv.sh or setenv.bat):

-Dcom.sun.management.jmxremote.port=<MY_JMX_PORT>
-Dcom.sun.management.jmxremote.ssl=false
-Dcom.sun.management.jmxremote.authenticate=false

Replace <MY_JMX_PORT> by a port number available allowing remote connection from the JConsole.

Note

Although it is possible to disable authentication by default, we do not recommend doing this in a production environment. For detailed information on how to secure your remote JMX connection, please refer to the Oracle documentation here.

The detailed documentation for monitoring on Tomcat can be found here.

Monitoring with JConsole

We recommend JConsole as a default JMX monitoring tool because it is part of the Java Development Kit (JDK). JConsole is a JMX-compliant graphical tool capable of monitoring both local and remote Java application. It provides critical insights into the Java application’s health and performance, enabling you to detect and address potential issues efficiently.

To effectively monitor your iObeya platform using JConsole, follow this step-by-step guide:

  1. Start JConsole from the /bin directory of your JDK installation directory.
  2. Choose Remote process from the connection options available.
  3. Enter the hostname of your iObeya platform along with the port you configured earlier for JMX remote connections (note: this is different from the iObeya HTTP port).
  4. Click on Connect to establish a connection with the JVM of your iObeya platform.
  5. Once connected, you can search for the com.iobeya property to access and review all relevant metrics, giving you insights into the performance and health of your platform.

For detailed instructions on using JConsole, refer to the Oracle documentation here.

As part of maintaining iObeya, you are responsible for establishing a reliable monitoring platform that connects to iObeya via JMX, ensuring continuous oversight and optimal operation of your systems.

JMX Attributes

Global Attributes

The following table lists metrics (Mbeans) grouped in the com.iobeya:

Mbean Name Attribute Description
asyncRequests PendingDownloadCount Number of downloads pending
  RunningRequestCount Number of requests currently running
asyncTaskExecutor ConcurrentPendingTaskCount Number of concurrent tasks pending
  ExclusivePendingTaskCount Number of exclusive tasks pending
  ExportPendingTaskCount Number of export tasks pending
  RemotePendingTaskCount Number of remote tasks pending
  TotalPendingTaskCount Total number of tasks pending
eventHandlerRetry GaveUpRetryCount Number of retries that were abandoned
  PendingRetryCount Number of retries pending
  RetriedCount Number of retries attempted
  SuccessfulRetryCount Number of successful retries
hibernate ConnectCount Number of connections made
  OptimisticFailureCount Number of optimistic failures
  QueryExecutionCount Number of queries executed
  QueryExecutionTimeMillisTotal Total time taken for query execution in milliseconds
  SecondLevelCacheHitCount Number of second-level cache hits
  SecondLevelCacheMissCount Number of second-level cache misses
  SuccessfulTransactionCount Number of successful transactions
  TransactionCount Total number of transactions
screenshots LastDurationBetweenScreenshotRequestAndGeneration Time taken between screenshot request and generation
  LastScreenshotGeneratedTime Time taken by the last screenshot that was generated
  ScreenshotGenerated Number of screenshots generated

Screenshot Attributes

The following table lists metrics (Mbeans) grouped in the com.iobeya.screenshot:

Mbean Name Attribute Description
basic-ThreadPoolExecutor ActiveScreenshot Number of active screenshots managed by the threads allocated to screenshots by default
  CompletedScreenshotCount Number of screenshots completed by the threads allocated to screenshots by default
  PendingScreenshot Number of screenshots pending for the threads allocated to screenshots by default
  ThreadsPoolSize Size of the thread pool allocated to screenshots by default
fast-ThreadPoolExecutor ActiveScreenshot Number of active screenshots managed by the threads allocated to fast screenshots
  CompletedScreenshotCount Number of screenshots completed by the threads allocated to fast screenshots
  PendingScreenshot Number of screenshots pending for the threads allocated to fast screenshots
  ThreadsPoolSize Size of the thread pool allocated to fast screenshots
slow-ThreadPoolExecutor ActiveScreenshot Number of active screenshots managed by the threads allocated to slow screenshots
  CompletedScreenshotCount Number of screenshots completed by the threads allocated to slow screenshots
  PendingScreenshot Number of screenshots pending for the threads allocated to slow screenshots
  ThreadsPoolSize Size of the thread pool allocated to slow screenshots

iObeya Events

Mbean Name Attribute Description
EventStoreMetrics EventCount Total number of stored events since last application startup
EventBusMetrics PublishedEventCount Total number of events read from store and published to handlers (once for each stored event, independently of the number of handlers for this event)
  PublicationErrorCount Total number of publication errors (excluding errors during processing)
  EventDeliveryTimeTotal Cumulative time of delivery (before event-processing)
  EventDeliveryTimeLe100MillisCount Total number of event deliveries which took less than 100ms
  EventDeliveryTimeLe500MillisCount Total number of event deliveries which took less than 500ms
  EventDeliveryTimeLast Duration of last event delivery (from command to publication, but not processing)
  EventDeliveryTimeAvg Average duration of event deliveries
  EventDeliveryTimeMax Max duration of event delivery
  EventDeliveryTimeStdDev Standard deviation of event delivery durations
EventHandlerMetrics ProcessedEventCount Total number of successful event processings (one for each handler on each corresponding event)
  ProcessingErrorCount Total number of errors that occurred during event processing (excluding errors on first try, including other retries)
  HandlerProcessingTimeTotal Cumulative time of successful event processings
  HandlerProcessingTimeLast Duration of last event processing
  HandlerProcessingTimeAvg Average of event processing durations
  HandlerProcessingTimeMax Max of event processing durations
  HandlerProcessingTimeStdDev Standard deviation of event processing durations
ViewQueries ViewQueriesCount Total number of view queries