Thread Monitor - Yaml configuration file

The Thead Monitor tool gathers thread dumps and Javacores at a configured interval, and during events such as high WebContainer/Default_Executor pool thread usage. Yaml configuration file must exist with name /SETUP/support/thread_monitor.yaml, or under the location specified with the THREAD_MONITOR_CFG environment variable.

The Yaml file is loaded during startup, and scanned for changes every minute. If the Yaml file is not readable during startup, no further attempts are made to load it during runtime.

By default, Thread Monitor is enabled.

Yaml file configurations:

The following is a list of various Yaml file configurations:

  • enabled: main switch. Uses THREAD_MONITOR_ENABLED environment variable. Defaults to false enabled: "${THREAD_MONITOR_ENABLED:-false}"
  • format: threaddump or javacore. Threaddumps are less costly format: threaddump.
  • directory: directory to which the threaddumps are written, and where archiving occurs.
  • It needs to match the directory used with -Xdump that configures where Javacores are written directory: "${DUMP_DIR}".
  • minCollectionInterval: To ensure threaddumps/javacores are not collected too frequently. Useful when triggers are enabled. Value is in seconds. It is not recommended to allow intervals shorter than 15 seconds. Use 0 to disable. minCollectionInterval: 15
  • archiving:
    • delayedZipNum: when doing realtime debugging, it is useful to read dumps as they get created.
    • This setting delays zipping the most recent N dumps so they remain available to review with 'vi'. delayedZipNum: 10
    • zipSize: number of dumps to include per zip file zipSize: 30
    • zipMaxAgeMins: deletes zips whose lastmodified time is older than the configured time in minutes. 0 to disable zipMaxAgeMins: 2880
    • zipMaxCount: only keep the last N zip files. 0 to disable zipMaxCount: 96
  • threaddumps:
    include: used to filter the threads that are saved to the threaddump file. Only thread names that start with the specified strings will be logged include:
    • WebContainer
    • Default Executor
    • main
    • pool
    • redisson
  • triggers:
    • interval: enables periodic collection of dumps. Value is in seconds. Interval: 30
    • webContainer: triggers dumps based on WebContainer/Default_Executor thread pool usage. The pool usage is evaluated when the monitor API triggers. When using prometheus, the default scrape interval is 15 seconds.
    • inUseLargerThan: trigger a dump when the number of active (not idle) threads is larger than the configured value inUseLargerThan: 21
    • format: use a format different than the default. When the number of threads available in the thread pool is low, it can be preferred to collect Javacores instead of Threaddumps as they have more information format: javacore.