17.4. HBase Metrics

HBase emits metrics which adhere to the Hadoop metrics API. Starting with HBase 0.95, HBase is configured to emit a default set of metrics with a default sampling period of every 10 seconds. You can use HBase metrics in conjunction with Ganglia. You can also filter which metrics are emitted and extend the metrics framework to capture custom metrics appropriate for your environment.

17.4.1. Metric Setup

For HBase 0.95 and newer, HBase ships with a default metrics configuration, or sink. This includes a wide variety of individual metrics, and emits them every 10 seconds by default. To configure metrics for a given region server, edit the conf/hadoop-metrics2-hbase.properties file. Restart the region server for the changes to take effect.

To change the sampling rate for the default sink, edit the line beginning with *.period. To filter which metrics are emitted or to extend the metrics framework, see http://hadoop.apache.org/docs/current/api/org/apache/hadoop/metrics2/package-summary.html

HBase Metrics and Ganglia

By default, HBase emits a large number of metrics per region server. Ganglia may have difficulty processing all these metrics. Consider increasing the capacity of the Ganglia server or reducing the number of metrics emitted by HBase. See Metrics Filtering.

17.4.2. Disabling Metrics

To disable metrics for a region server, edit the conf/hadoop-metrics2-hbase.properties file and comment out any uncommented lines. Restart the region server for the changes to take effect.

17.4.3. Discovering Available Metrics

Rather than listing each metric which HBase emits by default, you can browse through the available metrics, either as a JSON output or via JMX. At this time, the JSON output does not include the description field which is included in the JMX view. Different metrics are exposed for the Master process and each region server process.

Procedure 17.1. Access a JSON Output of Available Metrics

  1. After starting HBase, access the region server's web UI, at http://localhost:60030 by default.

  2. Click the Metrics Dump link near the top. The metrics for the region server are presented as a dump of the JMX bean in JSON format.

  3. To view metrics for the Master, connect to the Master's web UI instead (defaults to http://localhost:60010) and click its Metrics Dump link.

Procedure 17.2. Browse the JMX Output of Available Metrics

You can use many different tools to view JMX content by browsing MBeans. This procedure uses jvisualvm, which is an application usually available in the JDK.

  1. Start HBase, if it is not already running.

  2. Run the command jvisualvm command on a host with a GUI display. You can launch it from the command line or another method appropriate for your operating system.

  3. Be sure the VisualVM-MBeans plugin is installed. Browse to ToolsPlugins. Click Installed and check whether the plugin is listed. If not, click Available Plugins, select it, and click Install. When finished, click Close.

  4. To view details for a given HBase process, double-click the process in the Local sub-tree in the left-hand panel. A detailed view opens in the right-hand panel. Click the MBeans tab which appears as a tab in the top of the right-hand panel.

  5. To access the HBase metrics, navigate to the appropriate sub-bean:

    • Master: HadoopHBaseMasterServer

    • RegionServer: HadoopHBaseRegionServerServer

  6. The name of each metric and its current value is displayed in the Attributes tab. For a view which includes more details, including the description of each attribute, click the Metadata tab.

17.4.4. Units of Measure for Metrics

Different metrics are expressed in different units, as appropriate. Often, the unit of measure is in the name (as in the metric shippedKBs). Otherwise, use the following guidelines. When in doubt, you may need to examine the source for a given metric.

  • Metrics that refer to a point in time are usually expressed as a timestamp.

  • Metrics that refer to an age (such as ageOfLastShippedOp) are usually expressed in milliseconds.

  • Metrics that refer to memory sizes are in bytes.

  • Sizes of queues (such as sizeOfLogQueue) are expressed as the number of items in the queue. Determine the size by multiplying by the block size (default is 64 MB in HDFS).

  • Metrics that refer to things like the number of a given type of operations (such as logEditsRead) are expressed as an integer.

17.4.5. Most Important RegionServer Metrics

Previously, this section contained a list of the most important RegionServer metrics. However, the list was extremely out of date. In some cases, the name of a given metric has changed. In other cases, the metric seems to no longer be exposed. An effort is underway to create automatic documentation for each metric based upon information pulled from its implementation.

comments powered by Disqus