Uploaded image for project: 'HBase'
  1. HBase
  2. HBASE-5433

[REST] Add metrics to keep track of success/failure count

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.94.0
    • 0.94.0, 0.95.0
    • metrics, REST
    • None
    • Reviewed

    Description

      In a production environment, the visibility of successful REST request(s) are not getting exposed to metric system as we have only one metric (requests) today.
      Proposing to add more metrics such as successful_get_count, failed_get_count, successful_put_count, failed_put_count

      The current implementation increases the request count at the beginning of the method implementation and it is very hard to monitor requests (unless turn on debug, find the row_key and validate it in get/scan using hbase shell), it will be very useful to ops to keep an eye as requests from cross data-centers are trying to write data to one cluster using REST gateway through load balancer (and there is no visibility of which REST-server/RS failed to write data)

       Response update(final CellSetModel model, final boolean replace) {
          // for requests
          servlet.getMetrics().incrementRequests(1);
             ..  
             ..
            table.put(puts);
            table.flushCommits();
            ResponseBuilder response = Response.ok(); 
            // for successful_get_count
            servlet.getMetrics().incrementSuccessfulGetRequests(1);
            return response.build();
          } catch (IOException e) {
            // for failed_get_count
            servlet.getMetrics().incrementFailedGetRequests(1);
            throw new WebApplicationException(e,
                        Response.Status.SERVICE_UNAVAILABLE);
          } finally {
          }
        }
      

      Attachments

        1. HBASE-5433.trunk.v1.patch
          17 kB
          Mubarak Seyed

        Activity

          People

            mubarakseyed Mubarak Seyed
            mubarakseyed Mubarak Seyed
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: