Skip to main content
skomar89
Bronze III
August 21, 2023
Solved

Cloudera Manager HBase Trigger

Hi, 

we are trying to create an alert to get notification when no row was inserted into a given HBase table in given period of time. 

 

The following command was used: 

IF (SELECT total_write_requests_rate_across_regionservers WHERE serviceName=$SERVICENAME AND max(total_write_requests_rate_across_regionservers ) = 0 AND entityName = "hbase" AND category = "SERVICE") DO health:bad

but the name of HBase table is missing. 

The `htableName` property is mentioned under the https://docs.cloudera.com/documentation/enterprise/6/6.3/topics/cm_dg_tsquery.html#concept_d2g_k11_dk__section_cdx_sbp_3l chapter, but it does not work - the command return empty results after putting the `htableName` attribute to WHERE condition. 

Could I please to an advice, how to get a notification when entities are not inserted to the HBase table?

Anandh_S
Anandh_SAnswer
Gold ⭐️
October 4, 2023

This metric is specific to the region server level and cannot be sorted or filtered based on the table name. However, You can leverage the timerange option with scan to check if there are any rows inserted between two timestamps. By default, the timestamp represents the time on the RegionServer when the data was written, so unless you specify a different timestamp value when you put data into the cell, you can leverage with the cell timestamps to check the insertion time.

for example,

scan 'NS:TableName', { TIMERANGE => [1589621394000, 1589637999999] }

You can get epoch time from HBase shell as well using this option.

SimpleDateFormat.new("yy/MM/dd HH:mm:ss").parse("08/08/16 20:56:29", ParsePosition.new(0)).getTime() => 1218920189000

 

3 replies

DianaTorres
Community Manager
Community Manager
August 21, 2023

@skomar89 Welcome to the Cloudera Community!

To help you get the best possible solution, I have tagged our HBase experts @pajoshi @ChrisGe  who may be able to assist you further.

Please keep us updated on your post, and we hope you find a satisfactory solution to your query.

Translate
Regards, Diana Torres, Senior Community Moderator
Anandh_S
Gold ⭐️
Anandh_SAnswer
Gold ⭐️
October 4, 2023

This metric is specific to the region server level and cannot be sorted or filtered based on the table name. However, You can leverage the timerange option with scan to check if there are any rows inserted between two timestamps. By default, the timestamp represents the time on the RegionServer when the data was written, so unless you specify a different timestamp value when you put data into the cell, you can leverage with the cell timestamps to check the insertion time.

for example,

scan 'NS:TableName', { TIMERANGE => [1589621394000, 1589637999999] }

You can get epoch time from HBase shell as well using this option.

SimpleDateFormat.new("yy/MM/dd HH:mm:ss").parse("08/08/16 20:56:29", ParsePosition.new(0)).getTime() => 1218920189000

 

Translate
DianaTorres
Community Manager
Community Manager
October 10, 2023

@skomar89 Has the reply helped resolve your issue? If so, please mark the appropriate reply as the solution, as it will make it easier for others to find the answer in the future.  Thanks.

Translate
Regards, Diana Torres, Senior Community Moderator