Created 08-21-2023 01:44 AM
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_d... 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?
Created on 10-04-2023 01:48 AM - edited 10-04-2023 01:49 AM
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
Created 08-21-2023 10:07 AM
@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.
Regards,
Diana Torres,Created on 10-04-2023 01:48 AM - edited 10-04-2023 01:49 AM
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
Created 10-09-2023 08:49 PM
@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.
Regards,
Diana Torres,