Monitor element collection levels

The monitor element collection level for a monitor element refers to what, if any settings must be active for data to be collected for that element. For many monitor elements, data collection is controlled by configuration parameters, clauses in the DDL used to define workload management objects, or a combination of both.

Collection level settings

Setting collection levels using database configuration parameters sets the default collection level for a specific class of monitor elements for the entire database. For example, setting the configuration parameter mon_req_metrics to BASE causes request metrics to be collected for all agents running in the database. For request and activity metrics, and for section actuals monitor elements, you can also specify a collection level for specific WLM objects that is different from the level used for the database as a whole. In this way, the effective collection level for a given monitor element is determined by applying the broadest (highest) collection level specified for that element for the scope in which it is collected. See the section titled Examples for examples of how the different collection scopes work together.

Collection levels are used in the topics that describe most monitor elements. (Monitor elements returned by snapshot interfaces use monitor switches rather than collection levels.) For example, Table 1 shows the table that describes the interfaces that return the monitor element skipped_prefetch_data_p_reads, along with the monitor element collection level that must be active for data to be collected for this element.

Most topics include such a table to show what interfaces return the monitor element, and what the minimum collection level must be for data to be collect for the monitor element described in the topic.
Table 1. Table Function Monitoring Information
Table Function Monitor Element Collection Level
MON_GET_BUFFERPOOL table function - Get buffer pool metrics DATA OBJECT METRICS BASE
MON_GET_DATABASE table function - Get database level information DATA OBJECT METRICS BASE
MON_GET_DATABASE_DETAILS table function - Get database information metrics DATA OBJECT METRICS BASE
MON_GET_TABLESPACE table function - Get table space metrics DATA OBJECT METRICS BASE
The collection levels used in monitor element reference topics are as follows:
Always collected
Data for this monitor element is always collected. There are no configuration parameters, or SQL statement options to control collection of this information.
DATA OBJECT METRICS BASE, DATA OBJECT METRICS EXTENDED
Monitor elements with this collection level are collected if the database configuration parameter mon_obj_metrics is set to BASE or EXTENDED. If mon_obj_metrics is set to NONE, no data is collected.
REQUEST METRICS BASE, REQUEST METRICS EXTENDED
Monitor elements with this collection level are collected if the effective collection level set to BASE or EXTENDED. The effective collection level for request metrics is determined by examining the current setting for the database configuration parameter mon_req_metrics and the settings specified for the COLLECT REQUEST METRICS clause for WLM service superclasses.
ACTIVITY METRICS BASE, ACTIVITY METRICS EXTENDED
Monitor elements with this collection level are collected if the effective collection level set to BASE or EXTENDED. The effective collection level for activity metrics is determined by examining the current setting for the database configuration parameter mon_act_metrics and the settings specified for the COLLECT ACTIVITY METRICS clause for WLM workloads.
SECTION ACTUALS BASE
Monitor elements with this collection level are collected if the effective collection level set to BASE. The effective collection level for section actuals is determined by examining the current setting for the database configuration parameter section_actuals along with the settings for the following items:
  • The INCLUDE ACTUALS clause as part of the CREATE or ALTER WORKLOAD, CREATE or ALTER WORK ACTION SET, or CREATE or ALTER SERVICE CLASS statements.
  • The <collectsectionactuals> setting on the WLM_SET_CONN_ENV routine.
COLLECT AGGREGATE ACTIVITY DATA, COLLECT AGGREGATE REQUEST DATA
Monitor elements with this collection level are collected if the clause COLLECT AGGREGATE ACTIVITY DATA or COLLECT AGGREGATE REQUEST DATA is included as part of the CREATE or ALTER statement for specific types of WLM objects.
Some elements are marked as Not applicable; reports whichever elements are in the XML document that is provided as input to the formatting function. In these cases, the element is returned by a function that merely formats the output of event data already collected.

Examples

Example 1: Default collection level of NONE for the database as a whole, EXTENDED for a specific service super class.
This example shows how you can specific a collection level of NONE for, in this case, request metrics monitor elements for the database as a whole, but still collect EXTENDED metrics for agents running in a service super class.

To disable the collection of request metrics for agents running in the database in general, but collect extended metrics for a specific service super class, then perform the following steps:

  1. Set the collection level for request metrics for the database as whole to NONE by issuing the following command:
    DB2 UPDATE DB CFG FOR database-name USING MON_REQ_METRICS NONE
  2. Alter the service super class for which you want to collect request metrics by executing the following statement:
    ALTER SERVICE CLASS service-class-name COLLECT REQUEST METRICS EXTENDED

Results: Request metrics are collected for all agents that run in the service super class with the name service-class-name. Request metrics are not collected for agents that run outside of that service super class.

Example 2: Default collection level of EXTENDED for the database as a whole.
This example shows how the broadest collection level is applied for collecting monitor element data, perhaps with unintended consequences.
  • Specify that activity metrics are to be captured for all activities running in the database using the following command:
    DB2 UPDATE DB CFG FOR database-name USING MON_ACT_METRICS EXTENDED
  • Modify a WLM workload so that activity metrics are not collected:
    ALTER WORKLOAD workload-name COLLECT ACTIVITY METRICS NONE

Results: Activity metrics are collected for all agents running in the database, including those running as part of the workload workload-name. In this case, the effective collection level is determined by the broader collection level (EXTENDED) specified for the database as a whole through the mon_act_metrics configuration parameter.